package com.boesch.electroOffice.model.wrapper;

import java.io.Serializable;

import com.boesch.electroOffice.model.electroOffice.Identifier;
import com.boesch.electroOffice.model.electroOffice.WorkingHour;
import com.liferay.portal.model.User;

/**
 * A wrapper class for workingHours. It is used to display the workingHours on appointment.
 * 
 * @author Ralph Koster
 */
public class WorkingHoursEntry implements Serializable {

	private static final long serialVersionUID = 6251539603505895210L;

	private User user;
	private Identifier workingIdentifier;
	private WorkingHour monday;
	private WorkingHour tuesday;
	private WorkingHour wednesday;
	private WorkingHour thursday;
	private WorkingHour friday;
	private WorkingHour saturday;
	private WorkingHour sunday;
	private boolean isDefault;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Identifier getWorkingIdentifier() {
		return workingIdentifier;
	}

	public void setWorkingIdentifier(Identifier workingIdentifier) {
		this.workingIdentifier = workingIdentifier;
	}

	public WorkingHour getMonday() {
		return monday;
	}

	public void setMonday(WorkingHour monday) {
		this.monday = monday;
	}

	public WorkingHour getTuesday() {
		return tuesday;
	}

	public void setTuesday(WorkingHour tuesday) {
		this.tuesday = tuesday;
	}

	public WorkingHour getWednesday() {
		return wednesday;
	}

	public void setWednesday(WorkingHour wednesday) {
		this.wednesday = wednesday;
	}

	public WorkingHour getThursday() {
		return thursday;
	}

	public void setThursday(WorkingHour thursday) {
		this.thursday = thursday;
	}

	public WorkingHour getFriday() {
		return friday;
	}

	public void setFriday(WorkingHour friday) {
		this.friday = friday;
	}

	public WorkingHour getSaturday() {
		return saturday;
	}

	public void setSaturday(WorkingHour saturday) {
		this.saturday = saturday;
	}

	public WorkingHour getSunday() {
		return sunday;
	}

	public void setSunday(WorkingHour sunday) {
		this.sunday = sunday;
	}

	public void setIsDefault(boolean isDefault) {
		this.isDefault = isDefault;
	}

	public boolean getIsDefault() {
		return isDefault;
	}

	public double getTotal() {
		return (null != monday ? monday.getHours() : 0) + (null != tuesday ? tuesday.getHours() : 0) + (null != wednesday ? wednesday.getHours() : 0)
				+ (null != thursday ? thursday.getHours() : 0) + (null != friday ? friday.getHours() : 0) + (null != saturday ? saturday.getHours() : 0)
				+ (null != sunday ? sunday.getHours() : 0);
	}
}
